<?php
/**
 * Created by PhpStorm.
 * User: 顾明轩
 * Date: 2017/10/4
 * Time: 0:54
 */

function getpage($count, $pagesize = 10) {
    $p = new Think\Page($count, $pagesize);
    $p->setConfig('header', '<br/><span class="rows">共<b>%TOTAL_ROW%</b>条记录 第<b>%NOW_PAGE%</b>页/共<b>%TOTAL_PAGE%</b>页</span>');
    $p->setConfig('prev', '上一页');
    $p->setConfig('next', '下一页');
    $p->setConfig('last', '末页');
    $p->setConfig('first', '首页');
    $p->setConfig('theme', '%FIRST%%UP_PAGE%%LINK_PAGE%%DOWN_PAGE%%END%%HEADER%');
    $p->lastSuffix = false;//最后一页不显示为总页数
    return $p;
}


function display_name($str){
//    $length=(strlen($str) + mb_strlen($str,'UTF8')) / 2;
    if(mb_strlen($str)>15){
        $newStr = mb_substr($str,0,45,"UTF8")."...";
        return $newStr;
    }else{
        $newStr=$str;
        return $newStr;
    }

}

function retime($time){
    $cc=date('Y-m-d H:i:s',$time);
    return $cc;
}